package com.beijiteshop.shop.ui.shopcar.repo

import com.beijiteshop.libcommon.network.ext.BaseRsp
import com.beijiteshop.libcommon.network.ext.ResultRsp
import com.beijiteshop.shop.model.api.request.AddShopCarRequest
import com.beijiteshop.shop.model.api.request.GetGoodCountRequest
import com.beijiteshop.shop.model.api.response.GoodsCartCountBean
import com.beijiteshop.shop.model.api.response.PageDataBean
import com.beijiteshop.shop.model.api.response.ShoppingCartBean
import retrofit2.Call
import retrofit2.http.*

/**
 * @Author LiaoZhongKai
 * @Date 2021/3/19 16:00
 * @Description
 */
interface ShopCarService {

    @POST("/api/shopcart/add")
    fun addToShopCar(@Body request: AddShopCarRequest): Call<ResultRsp>

    @GET("/api/shopcart/getcartgoods")
    fun getShopCarList(@Query("page") page: Int): Call<BaseRsp<PageDataBean<MutableList<ShoppingCartBean>>>>

    @POST("/api/shopcart/deletecart")
    fun deleteGoods(@Query("shopCartId") id: String): Call<ResultRsp>

    @POST("/api/shopcart/addcount")
    fun addCount(@Query("shopCartId") id: String): Call<ResultRsp>

    @POST("/api/shopcart/subtractcount")
    fun reduceCount(@Query("shopCartId") id: String): Call<ResultRsp>

    //color不为空
    @GET("/api/shopcart/getgoodcount")
    fun getGoodCount(@Query("BusGoodId")busGoodId: String,@Query("Color")color: String,@Query("Specification")specification: String): Call<BaseRsp<GoodsCartCountBean>>

    //color为空
    @GET("/api/shopcart/getgoodcount")
    fun getGoodCount(@Query("BusGoodId")busGoodId: String,@Query("Specification")specification: String): Call<BaseRsp<GoodsCartCountBean>>
}